package com.easyOrder.core.utils;

import com.easyOrder.core.json.probe.ObjectProbe;
import com.easyOrder.core.json.probe.MapProbe;
import com.easyOrder.core.json.probe.SimpleObjectProbe;

import java.util.Map;

public final class ObjectUtil {
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static ObjectProbe getProbe(Object obj) {
		if (obj instanceof Map) {
			return new MapProbe((Map) obj);
		}
		return new SimpleObjectProbe(obj);
	}

	public static boolean equals(Object objA, Object objB) {
		if (objA == objB) {
			return true;
		}
		if ((objA != null) && (objB != null)) {
			return objA.equals(objB);
		}
		return false;
	}
}
